﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Reflection;
using System.IO;

namespace NExt.Handler.Component.Default.JsSerialize
{
    public class InheritanceScriptGenerator : AbstractNExtScriptGenerator
    {
        private const string SCRIPT_POSTFIX = "Inheritance.js";
        private const string EXTEND_SCRIPT_FORMAT = "Ext.extend({0}, {1}, {{}});";

        public InheritanceScriptGenerator()
            : base(SCRIPT_POSTFIX)
        {
        }

        protected override string BuildDefaultContent(Type type)
        {
            string fullName = type.FullName;
            string baseTypeFullName = type.BaseType.FullName;
            string content = string.Format(EXTEND_SCRIPT_FORMAT, fullName, baseTypeFullName);

            return content;

        }
    }
}
